{extend name='admin@main'}

{block name="button"}

{if auth("get_user")}
<a class="layui-btn layui-btn-sm layui-btn-normal" data-confirm="确定要同步员工列表信息吗？" data-value="id#{key}" data-action="{:url('get_user')}">同步员工列表信息</a>
{/if}

{/block}

{block name="content"}
<style>
    .layui-badge{
        margin: 1px;
    }
</style>
<div class="think-box-shadow">
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='text-center nowrap'>用户打卡地址</th>
            <th class='text-center nowrap'>定位方法</th>
            <th class='text-center nowrap'>是否合法</th>
            <th class='text-left nowrap'>实际打卡时间</th>
            <th class='text-left nowrap'>计算迟到和早退，基准时间</th>
            <th class='text-left nowrap'>打卡结果</th>
            <th class='text-center nowrap'>位置结果</th>
            <th class='text-center nowrap'>考勤类型</th>
            <th class='text-left nowrap'>数据来源</th>
            <th class='text-center nowrap'>工作日</th>
            <th class='text-left nowrap'>异常信息类型</th>
            <th class='text-left nowrap'>异常信息的具体描述</th>
            <th class='text-left nowrap'>打卡记录创建时间</th>
            <th class='text-left nowrap'>打卡记录修改时间</th>
            <th class='text-left nowrap'>打卡备注</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='text-center nowrap'>{$vo.userAddress|default=''}</td>
            <td class='text-center nowrap'>{$vo.locationMethod|default=''}</td>
            <td class='text-center nowrap'>
                {if isset($vo.isLegal)}
                {eq name='vo.isLegal' value='Y'}<span class="color-green">合法</span>{/eq}
                {eq name='vo.isLegal' value='N'}<span class="color-red">不合法</span>{/eq}
                {else}
                无
                {/if}
            </td>
            <td class='text-center nowrap'>{$vo.userCheckTime/1000|format_datetime}</td>
            <td class='text-center nowrap'>
                {if isset($vo.baseCheckTime)}
                    {$vo.baseCheckTime/1000|format_datetime}
                {else}
                无
                {/if}
            </td>
            <td class='text-center nowrap'>
                {if isset($vo.timeResult)}
                    {if $vo.timeResult == 'Normal'}
                    正常
                    {elseif $vo.timeResult == 'Early'}
                    早退
                    {elseif $vo.timeResult == 'Late'}
                    迟到
                    {elseif $vo.timeResult == 'SeriousLate'}
                    严重迟到
                    {elseif $vo.timeResult == 'Absenteeism'}
                    旷工迟到
                    {elseif $vo.timeResult == 'NotSigned'}
                    未打卡
                    {/if}
                {else}
                无
                {/if}
            </td>
            <td class='text-center nowrap'>
                {if isset($vo.locationResult)}
                    {if $vo.locationResult == 'Normal'}
                    范围内
                    {elseif $vo.locationResult == 'Outside'}
                    范围外
                    {elseif $vo.locationResult == 'NotSigned'}
                    未打卡
                    {/if}
                {else}
                无
                {/if}
            </td>
            <td class='text-center nowrap'>
                {if isset($vo.checkType)}
                    {if $vo.checkType == 'OnDuty'}
                    上班
                    {elseif $vo.checkType == 'OffDuty'}
                    下班
                    {/if}
                {else}
                无
                {/if}
            </td>
            <td class='text-center nowrap'>
                {if $vo.sourceType == 'ATM'}
                考勤机打卡（指纹/人脸打卡）
                {elseif $vo.sourceType == 'BEACON'}
                IBeacon
                {elseif $vo.sourceType == 'DING_ATM'}
                钉钉考勤机（考勤机蓝牙打卡）
                {elseif $vo.sourceType == 'USER'}
                用户打卡
                {elseif $vo.sourceType == 'BOSS'}
                老板改签
                {elseif $vo.sourceType == 'APPROVE'}
                审批系统
                {elseif $vo.sourceType == 'SYSTEM'}
                考勤系统
                {elseif $vo.sourceType == 'AUTO_CHECK'}
                自动打卡
                {/if}
            </td>
            <td class='text-center nowrap'>{$vo.workDate/1000|format_datetime}</td>
            <td class='text-center nowrap'>
                {if isset($vo.invalidRecordType) && $vo.invalidRecordType == 'Security'}
                安全相关原因
                {elseif isset($vo.invalidRecordType) && $vo.invalidRecordType == 'Other'}
                其他原因
                {else}
                无
                {/if}
            </td>
            <td class='text-center nowrap'>{$vo.invalidRecordMsg|default=''}</td>
            <td class='text-center nowrap'>{$vo.gmtCreate/1000|format_datetime}</td>
            <td class='text-center nowrap'>{$vo.gmtModified/1000|format_datetime}</td>
            <td class='text-center nowrap'>{$vo.outsideRemark|default=''}</td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
